package com.sugree.util.parser;

import java.io.InputStream;
import java.util.List;

import android.util.Xml;

import com.sugree.util.entity.Message;

public class SaxFeedParser extends BaseFeedParser {

	public SaxFeedParser(InputStream is) {
		super(is);
	}

	public List<Message> parse() {
		RssHandler handler = new RssHandler();
		try {
			Xml.parse(this.getInputStream(), Xml.Encoding.UTF_8, handler);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
		return handler.getMessages();
	}
}
